package com.community.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200, "成功"),
    FAIL(201, "失败"),
    PARAM_ERROR(202, "参数不正确"),


    OVER_STOCK(301,"选择商品数量超过库存"),
    ZERO_ERROR(302, "选择商品数量不能为0"),
    EMPTY_PASSWORD(303, "支付密码为空,请先设置支付密码"),
    PASSWORD_ERROR(304, "支付密码错误"),
    NOT_ENOUGH(305, "钱包余额不足"),
    SELF_ERROR(306, "不能向自己转账"),
    PARING_ERROR(307, "每个车位最多绑定两辆车"),


    USER_LOGIN_AUTH(501, "未登录"),
    USER_LOGIN_PHONE_EMPTY(502, "手机号码为空"),
    USER_LOGIN_CODE_EMPTY(503, "验证码为空"),
    USER_SEND_SMS_TOO_OFTEN(504, "验证码发送过于频繁"),
    USER_LOGIN_CODE_EXPIRED(505, "验证码已过期"),
    USER_LOGIN_CODE_ERROR(506, "验证码错误"),
    USER_ACCOUNT_DISABLED_ERROR(507, "该用户已被禁用"),
    USER_ACCOUNT_NOT_EXIST_ERROR(508, "账号不存在"),
    USER_ACCOUNT_ERROR(509, "手机号或密码错误"),
    USER_ACCOUNT_EXIST_ERROR(510, "账号已存在"),


    TOKEN_EXPIRED(601, "token过期"),
    TOKEN_INVALID(602, "token非法");


    private final Integer code;

    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
